from fastapi import APIRouter
from src.huey_init.storages import Storage
from src.build_aitemplate.datamodel import AITemplateModel
from src.build_aitemplate.tasks import run_aitemplate_task

router = APIRouter(
    prefix="/generate",
    tags=["generate"],
    responses={404: {"description": "Not found"}}
)
# 建模功能入口
@router.post("/template")
async def aitemplate(aitemplate_model: AITemplateModel):
    res = run_aitemplate_task(aitemplate_model)
    return {"status": "success", "aitask_id": res.id}
